<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <head>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css" />
    </head>
</head>

<body>
    <div id='app'>
        <button @click='flag = !flag'>切换动画</button>
        <transition appear  enter-active-class = 'animate__animated animate__heartBeat' leave-active-class='animate__animated animate__backOutDown'>
            <div v-show='flag' style="font-size: 40px; text-align: center;">哈哈哈哈哈哈哈</div>
        </transition>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                flag:true
            }
        })
    </script>
</body>

</html>